\chapter{Interaction Viewpoint}
\label{cap:InteractionViewpoint} 

%%%%% EHHHHHHHHHH!!!!!!!
%%%% E VA BENE COSì  !!!!!      EEEEEEEEEEEEHHHHHHHH !!!!!!  %%


Here we want to focus on the interaction between the parts of the web module system and its users.

We considered a user navigating the Swimv2 system using a \textbf{browser} and we  model what happens when he asks for a page. 

At first the browser send a HTTP Request to the \textbf{tomcat} server (e.g. he ask using the POST method) then the server call a controller servlet according to the address asked by the user.

The \textbf{servlet }has the function of controller because handles the user request.
The servlet use the forward( page ) method of the \textbf{dispatcher} to redirect the navigation to another jsp, if it is needed the servlet can send data to the \textbf{jsp~ page} for instance exploiting the setAttribute method.

Finally the jsp page is executed and produces HTML code that can be parsed by the browser that will display the page content to the user.


\begin{figure}[htbp]
	\centering
	\includegraphics[width=\textwidth]{images/servlet}
	\caption{User and System web parts sequence diagram \label{fig:seqdiagram}}
\end{figure}